public class Person {

    public String name;
    public int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
        // System.out.println("带2个参数的构造方法");
    }

    public Person() {
        this("bit", 20);
        // System.out.println("不带参数的构造方法");
    }

    public Person(int age) {
        this.age = age;
    }

    public Person(String name) {
        this.name = name;
    }

    public void eat() {
        System.out.println(this.name + "正在吃饭...");
    }

    public void sleep() {
        System.out.println(this.name + "正在睡觉...");
    }

    public void func() {
        this.eat();
        this.sleep();
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
